Skip to content

Normative: reject primitive iterables in sumPrecise - #4102

Open
bakkot wants to merge 1 commit into
tc39:mainfrom
bakkot:no-iterate-sumprecise-strings
Open

bakkot wants to merge 1 commit into
tc39:mainfrom
bakkot:no-iterate-sumprecise-strings

Conversation

@bakkot

@bakkot bakkot commented Nov 24, 2026

Copy link
Copy Markdown
Member

I drafted this method before we added our normative convention to reject primitives in iterable positions. But this method requires the iterable to contain numbers, so the only way for passing a primitive to not throw is if it results in an empty iterator (e.g. the empty string) or by defining a custom Symbol.iterator on a primitive type. Since those are both very unlikely, we can almost certainly follow the new convention.

@github-actions

Copy link
Copy Markdown

The rendered spec preview for this PR is available as a single page at https://tc39.es/ecma262/pr/4102 and as multiple pages at https://tc39.es/ecma262/pr/4102/multipage .

@ljharb ljharb added the normative change Affects behavior required to correctly evaluate some ECMAScript source text label Nov 24, 2026
@nicolo-ribaudo nicolo-ribaudo added needs consensus This needs committee consensus before it can be eligible to be merged. needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 labels Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs consensus This needs committee consensus before it can be eligible to be merged. needs test262 tests The proposal should specify how to test an implementation. Ideally via github.com/tc39/test262 normative change Affects behavior required to correctly evaluate some ECMAScript source text

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants